﻿using System.Data;
using System.Data.SqlClient;

namespace RCSP.DataAccess
{
    public class PresetDataAccess : RCSPDatabaseAccess
    {
        public PresetDataAccess()
        {
        }

        public PresetDataAccess(string connectionString)
            : base(connectionString)
        {
        }

        public DataSet GetPresetByType(int presetType)
        {
            var command = new SqlCommand
            {
                Connection = Connection,
                CommandType = CommandType.StoredProcedure,
                CommandText = "GetPresetByType"
            };

            command.Parameters.Add(new SqlParameter("@PRSET_TYPE", presetType));
            Connection.Open();
            var adapter = new SqlDataAdapter(command);
            var ds = new DataSet();
            adapter.Fill(ds, "PRSET_TYPE");

            return ds;
        }
    }
}
